interface Bird {
	fly: boolean;
	sing: () => {};
}

interface Dog {
	fly: boolean;
	bark: () => {};
}

const handleTrain = (animal: Dog | Bird) => {
	if (animal.fly) {
		(animal as Bird).sing();
	} else {
		(animal as Dog).bark();
	}
};
